# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=haruna
pkgver=0.12.3
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://invent.kde.org/multimedia/haruna"
pkgdesc="Open-source video player built with Qt/QML and libmpv"
license="GPL-2.0-or-later AND GPL-3.0-or-later AND BSD-3-Clause"
depends="
	kirigami2
	yt-dlp
	"
makedepends="
	extra-cmake-modules
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtquickcontrols2-dev
	mpv-dev
	ffmpeg-dev
	breeze-dev
	kconfig5-dev
	kcoreaddons5-dev
	kdoctools5-dev
	kfilemetadata5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	kirigami2-dev
	kxmlgui5-dev
	samurai
	"
subpackages="$pkgname-lang $pkgname-doc"
_repo_url="https://invent.kde.org/multimedia/haruna.git"
source="https://download.kde.org/stable/haruna/haruna-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3fe872654f29382c800670a7c8ec75e03de5c5dbe3c95dc6d77935a9eaa88aeeb41f61ac8593bafded8aaa9b6e63ced04a8bdaaa18efbca7375826abee4246d3  haruna-0.12.3.tar.xz
"
